<?php
/*
何ページ目の結果リストが欲しいのかを指定します。*指定の無い場合は1ページ目が検索されます。
1200件を超えるページ指定はできません。1200件を超える場合は指定可能な最終ページが検索されます。
*/
    $APIMaxPage = 60;//1200/20;
		$key = array(
        "f0bfb6bc9b026c73f9f2460731f87469",
        "b0572c65d75b8edf330bf88354b8d761",
        "18e1df1b7387543cc580ebe9c55294a1",
        "aa06e5233dabf12b12f68e17c401f71b",
        "338c79a409a3e4312ca954821681a587"
		);
		$ItemUrl = "http://api.kakaku.com/WebAPI/ItemInfo/Ver1.0/ItemInfo.ashx?";
		$ListUrl = "http://api.kakaku.com/WebAPI/ItemSearch/Ver1.0/ItemSearch.aspx?";
		$XmlOrJson = "XML";
		$ListModel = array(
			"Available"	=> "NumOfResult",//all count
			"item"		=> array(
								"Item=>{n}"	=> array(
										"site"		=> "kakaku",
										"title"		=> "ProductName",
										"itemid"	=> "ProductID",
										"img"		=> "ImageUrl",
										"price"		=> "LowestPrice",
										"bidorbuy"	=> "",
										"store"		=> "",
										"NewItem"	=> "",
										"bids"		=> "",//auction
										"starttime"	=> "SaleDate",
										"endtime"	=> "",
										"timeleft"	=> "",
										"itemCaption"		=> "Comment"
								)
							)
		);
		$ItemModel = array(
			"title"		=> "ProductName",
			"itemid"	=> "ProductID",
			"img"		=> "ImageUrl",
			"url"		=> "ItemPageUrl",
			"price"		=> "LowestPrice",//現在価格です
			"quantity"	=> "",//商品の数量です。
			"bidorbuy"	=> "",//即決価格です
			"bids"		=> "",//現在の入札数です
			"condition"	=> "",//商品の状態です。
			"endtime"	=> "",
			"remaintime"=> "",//残り時間
			"store"		=> ""//有 StoreIcon :オークションストアの出品   无:一般の出品者の出品
		);

		$Category = array(
			"All"			=>	"ALL",//所有
			"Cameras"		=>	"Camera",//カメラ
			"Electronics"	=>	"Kaden",//电子 家電、AV、カメラ
			"VideoGames"	=>	"Game",//电子游戏
			"Baby"			=>	"Baby",//宝贝
			"SportingGoods"	=>	"Sports",//体育用品オ
			
			//"Automotive"	=>	"Kuruma",//汽车
			//"Beauty"		=>	"Beauty_Health",//美容ビューティー
			//"Computer"		=>	"Pc",//电脑
			//"HealthPersonalCare"	=>	"Beauty_Health",//健康个人护理
			//"MusicalInstruments"	=>	"Gakki",//乐器ア
			//"Pets"			=>	"Pet",//ペット、生き物
			//"Watches"		=>	"Brand",//钟表アクセサリー、時計
		);
		$SortOrder = array(
			"end,A"		=>	"-pricerank",//high to low
			"end,D"		=>	"pricerank",
			"price,A"	=>	"",
			"price,D"	=>	"daterank",
			"bids,A"		=>	"",
			"bids,D"		=>	"popularityrank"
		);

		//http://apiblog.kakaku.com/KakakuItemInfoV1.0.html
		$ItemParam = array(
			"ApiKey"		=> $key[rand(0,4)],
			"ProductID"     => _GET("itemid"),
			"ResultSet"     => "medium"
		);
		
		//http://apiblog.kakaku.com/KakakuItemSearchV1.0.html
		$ListParam = array(
			"ApiKey"		=> $key[rand(0,4)],
			"Keyword"       => $keyword,
			"ResultSet"     => "medium",
			//"CategoryGroup" => $Category[$_GET["c"]],
			"CategoryGroup" => checknull("id", checknull(_GET("c"), $SiteCate["shopping"]["kakaku"])),
			"CategoryGroup_all"    => checknull("kakaku", checknull(_GET("c"), $SiteCate["shopping"]["all"])),
			//"SortOrder"     => empty($_GET["s"])?"":$SortOrder[$_GET["s"]],
			"SortOrder"		=> checknull(_GET("s"), $SortOrder),
			//"HitNum"        => empty($_GET["n"])?"20":$_GET["n"],
			"HitNum"        => "20",
			"PageNum"       => $pagenum,
			"Charset"		=> "",
			"minprice"      => _GET("Minprice"),
			"maxprice"      => _GET("Maxprice")
		);
?>